/*
*用途：购物车表
*作者：hwq
*创建日期：2019-01-14 16:50
*/
const Sequelize = require('sequelize')
const sequelize = require('./sequelize')
const User = require('./user')
const Goods = require('./goods')

const ShopCar = sequelize.define('shopcar', {
  id: { type: Sequelize.INTEGER, allowNull: false, autoIncrement: true, primaryKey: true },
  uid: { type: Sequelize.INTEGER, references: { model: User, key: 'id' } },
  goodsid: { type: Sequelize.INTEGER, references: { model: Goods, key: 'id' } },
  count: { type: Sequelize.INTEGER },
  title: { type: Sequelize.STRING },
  price: { type: Sequelize.DOUBLE },
  img: { type: Sequelize.STRING },
})

module.exports = ShopCar